///************************************************************************
/// <copyrigth>2018-2019 Corporation.All Rights Reserved</copyrigth>
/// <author>tangyingzhong</author>
/// <contact>tangyz114987@outlook.com</contact>
/// <version>v1.0.0</version>
/// <describe>
/// It is duty for the app starting and stopping
///</describe>
/// <date>2020/7/26</date>
///***********************************************************************
#ifndef APP_H
#define APP_H

#include "Model/IFramework.h"

class App
{
public:
	// Construct the App
	App();

	// Detructe the App
	~App();

private:
	// Forbid the copy App
	App(const App& other) {	};

	// Forbid the assigment of App
	App& operator=(const App& other) { return *this; };

public:
	// Start the app
	bool Start();

	// Stop the app
	bool Stop();

	// Is core's debug mode
	bool IsDebugMode();

private:
	// Start the frame
	bool StartFramework();

	// Stop the frame
	bool StopFramework();

private:
	// Initialize the App
	void Initialize();

	// Destory the App
	void Destory();

	// Create the frame
	void CreateFramework();

	// Destory the frame
	void DestoryFramework();

private:
	// Get Framework
	inline IFramework* GetFramework() const
	{
		return m_pFramework;
	}

	// Set Framework
	inline void SetFramework(IFramework* pFramework)
	{
		m_pFramework = pFramework;
	}

	// Get the disposed status
	inline bool GetDisposed() const
	{
		return m_bDisposed;
	}

	// Set the disposed status
	inline void SetDisposed(bool bDisposed)
	{
		m_bDisposed = bDisposed;
	}

private:
	// Framework
	IFramework* m_pFramework;

	// Framework loader
	PluginLoader<IFramework> m_Loader;

	// Is show micro core UI
	bool m_bIsShowUI;

	// Disposed status
	bool m_bDisposed;
};

#endif // APP_H
